////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//
//
// This file is part of the Microsoft .NET Micro Framework Porting Kit Code Samples and is unsupported.
// Copyright (C) Microsoft Corporation. All rights reserved. Use of this sample source code is subject to
// the terms of the Microsoft license agreement under which you licensed this sample source code.
//
// THIS SAMPLE CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
//
//
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

#ifndef _DRIVERS_PAL_I2C_H_
#define _DRIVERS_PAL_I2C_H_

//--//

#include "Tinyhal.h"
#include "AsyncprocCalls_decl.h"

struct I2C_Driver
{
    HAL_DblLinkedList<HAL_CONTINUATION> m_xActions;
    BOOL                                m_initialized;

    //--//

    static BOOL Initialize  ();
    static BOOL Uninitialize();
    static BOOL Enqueue     ( I2C_HAL_XACTION* xAction, HAL_CALLBACK_FPN xActionCompleted );
    static void Cancel      ( I2C_HAL_XACTION* xAction, bool signal );
	static void StartNext   ();
	static void CompletedCallback( void* arg );
    //--//
};

///////////////////////////////////////////////////////////////////////////////

#endif // _DRIVERS_PAL_I2C_H_
